package main

import (
	"encoding/base64"
	"fmt"
	"gitee.com/fierce_wolf/go-fox-edge-common/commUtil/AES"
)

func main1() {
	// 密钥长度必须是16(AES-128)、24(AES-192)或32(AES-256)字节
	key := []byte("comic-2025-03-26")

	plaintext := []byte("Hello, AES-GCM encryption in Go!")

	// 加密
	encrypted, err := AES.GCM.Encrypt(plaintext, key)
	if err != nil {
		fmt.Println("加密错误:", err)
		return
	}
	fmt.Println("加密结果(Base64):", base64.StdEncoding.EncodeToString(encrypted))

	// 解密
	decrypted, err := AES.GCM.Decrypt(encrypted, key)
	if err != nil {
		fmt.Println("解密错误:", err)
		return
	}
	fmt.Println("解密结果:", string(decrypted))
}
